package com.android.powerbankpad.bean;

import android.text.TextUtils;

import androidx.annotation.Nullable;

public class SocketInfo {
    public String ip = null;
    public int port = 0;

    @Override
    public boolean equals(@Nullable Object obj) {
        if (!(obj instanceof SocketInfo))
            return false;

        SocketInfo socketInfo = (SocketInfo) obj;
        if (socketInfo == null || TextUtils.isEmpty(socketInfo.ip))
            return false;
        return (socketInfo.ip.equals(ip) && socketInfo.port == port);
    }

    @Override
    public String toString() {
        return "{" +
                "ip='" + ip + '\'' +
                ", port=" + port +
                '}';
    }
}
